<!DOCTYPE html>
<html lang="en" ng-app="myApp" class="no-js">
	<head>
		  <meta charset="utf-8">
		  <meta http-equiv="X-UA-Compatible" content="IE=edge">
		  <title>沿途&nbsp家校通 </title>
		  <meta name="description" content="">
		  <meta name="viewport" content="width=device-width, initial-scale=1">
		  <link rel="shortcut icon" href="favicon.ico" />

		  <link rel="stylesheet" href="bower_components/html5-boilerplate/css/normalize.css">
		  <link rel="stylesheet" href="bower_components/html5-boilerplate/css/main.css">
		  <link rel="stylesheet" href="app.css">
		  <link rel="stylesheet" href="css/zui.css">
		  <link rel="stylesheet" type="text/css" href="css/shc.css" />
		  <script src="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script>
	</head>

	<body>

		<app-header></app-header>

		<div ng-controller="loginCtrl" style="width:380px;margin:80px auto;">
			
		  	<div class="input_box">
		  		<input type="text" id="nativeid"  ng-model="nativeid" placeholder="身份证号">
		  	</div>
		  	<div class="input_box">
		  		<input type="password" id="password"  placeholder="6-16位">
		  	</div>
			<button style="width:100%;height:45px;margin-top:10px;" ng-click="login()"  class="btn btn-primary pull-right" >
				登&nbsp录
			</button>
		</div>   
			
		<app-footer></app-footer>

	  	<script src="lib/jquery/jquery.js"></script> 
	  	<script src="js/zui.js"></script>
	  	<script src="scripts/function.js"></script>

	  	<script src="bower_components/angular/angular.js"></script>

	  	<script type="text/javascript">
			var myApp = angular.module('myApp',[]);
			myApp.controller('loginCtrl', ['$scope','$http', function($scope,$http) {	
				$scope.nativeid = kget('nativeid');
			 	$scope.login = function(){
			 		var login_data = {
						'nativeid' : $("#nativeid").val(),
						'password' : $("#password").val()
			 		};
			 		$http.post('user/login', login_data).success(function(data){
			            if(!data.error ){
			  				kset("nativeid",login_data.nativeid);
			           		window.location.href = '/';           	
			            }else{
			                alert(data.message);
			            }
			 		});
				}
			}]);
			myApp.controller('menuCtrl', ['$scope', function($scope) {	
				$scope.islogin = false;
			}]);	
	  	</script>
		<script src="scripts/directives/header.js"></script>
		<script src="scripts/directives/footer.js"></script>   
	</body>
</html>

